package helperDao

import (
	"gitee.com/yangguoliang001/go-gin-vue3/BO"
	"gitee.com/yangguoliang001/go-gin-vue3/QO"
	"gitee.com/yangguoliang001/go-gin-vue3/vo"
	"gorm.io/gorm"
)

type HelperDao interface {
	QueryTables(dbName string) (tables []BO.DbTablesBO, err error)
	QueryTableColumns(req QO.SearchMysqlReq) (columnsRes []BO.TableColBO, err error)
	QueryTableData(sql string) (searchRes vo.SearchMysqlDataVO, err error)
}

type helperDao struct {
	db *gorm.DB
}

func New(db *gorm.DB) HelperDao {
	return &helperDao{
		db: db,
	}
}
